package com.example.canal.elasticsearch.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2021/8/8 16:34
 */
@Data
@Document(indexName = "tb_commodity_info", createIndex = true)
public class TbCommodityInfo implements Serializable {
    /**
     * 主键id
     */
    @Id
    private String id;
    /**
     * 商品名称
     */
    @Field(analyzer = "ik", type = FieldType.Text)
    private String commodityName;
    /**
     * 商品价格
     */
    @Field(type = FieldType.Keyword)
    private String commodityPrice = "0";
    /**
     * 商品数量
     */
    @Field(type = FieldType.Text)
    private Integer number;
    /**
     * 商品描述
     */
    @Field(type = FieldType.Keyword)
    private String description;

}
